#include "dominion_helpers.h"
#include "dominion.h"
#include "rngs.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

void myAssert(int a, int b)
{
	if (a != b)
		printf("error\n");
}

// cardEffect(int card, int choice1, int choice2, int choice3, 
//           struct gameState *state, int handPos, int *bonus)
int main()
{
	printf("Testing cardEffect, case = baron:\n");
	// Type   = action
	// Effect = +1 Buy, You may discard an Estate card. If you do,
	// 			+4 coins. Otherwise, gain an Estate Card
	// Cost   = 4 coins

	int p = 0;
	struct gameState g, t;

	g.numPlayers = 2;
	g.whoseTurn = p;
	g.handCount[p] = 5;	
	g.supplyCount[estate] = 5;
	g.deckCount[0] = 5;

	memcpy(&t, &g, sizeof(struct gameState));
	
	//choose to gain an estate
	cardEffect(baron, 0, 0, 0, &t, 0, 0);
	
	myAssert(6, t.deckCount[0]);
	myAssert(4, g.supplyCount[estate]);

	printf("Tests Done\n"); return 0;
}
